package org.softmed.neodatis.util.reflection;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

import org.softmed.reflection.utils.FieldInfo;

public class ClassGeneratedFieldInfo {
	Map<String, FieldInfo> fields = new HashMap<String, FieldInfo>();

	public FieldInfo getFieldInfo(String fieldName) {
		return fields.get(fieldName);
	}

	public void registerField(Class declaringClass, String fieldName,
			Method getter, Method setter, Class paramType) {
		FieldInfo info = new FieldInfo(fieldName, getter, setter, paramType);
		info.setDeclaringClass(declaringClass);
		fields.put(fieldName, info);
	}

	public void registerField(FieldInfo info, String fieldName) {
		fields.put(fieldName, info);
	}

	public Map<String, FieldInfo> getFields() {
		return fields;
	}

}
